#include "gObject.h"

gObject::gObject()
{
	m_phyObj = 0;
}

gObject::~gObject()
{

}

void gObject::init(
	WINAPP*       a_app,
	WINFPS*       a_fps,
	WINTIME*      a_time,
	D3DF*         a_d3d,
	DINF*         a_din,
	Physic_World* a_world)
{
	clkAbstract::init(FRAMEWORKS_ARG_REG);
	m_world = a_world;
}

void gObject::initPhysics()
{
	m_phyObj = 0;
}

void gObject::initPhysics(Physic_Object* a_phyObj)
{
	m_phyObj = a_phyObj;

	m_trn.x = m_phyObj->getPosition().x;
	m_trn.y = m_phyObj->getPosition().y;
	m_trn.z = m_phyObj->getPosition().z;
	m_scl.x = m_scl.y = m_scl.z = m_phyObj->getRadius()/10;
}

void gObject::update()
{
	if(m_phyObj)
	{
		m_trn.x = m_phyObj->getPosition().x;
		m_trn.y = m_phyObj->getPosition().y;
		m_trn.z = m_phyObj->getPosition().z;
		m_scl.x = m_scl.y = m_scl.z = m_phyObj->getRadius()/10;
	}

	clkMesh::update();
}